############################################################## 
## MOD Title: Multiple Accounts per Email Address Mod
## MOD Author: Wildfire < wildfire@macrossgenerations.com > (Sara Miller) www.winternightex.com 
## MOD Description: This Mod lets the administrator configure the board to allow multiple accounts per email address through the admin panel
## MOD Version: 1.0.1 
## 
## Installation Level: Easy
## Installation Time: 5 Minutes 
## Files To Edit: includes/functions_validate.php, admin/admin_board.php, templates/subSilver/admin/board_config_body.tpl
## Included Files: n/a 
############################################################## 
## Author Notes: 
##  This Mod requires modification of the phpBB database.  If you are incapable of or 
##  are not comfortable with doing so, please do not attempt installation of this MOD.
##  Upon completion of installation, the confuration option will be set to allow multiple
##  accounts per email address.  
##
##  CHANGELOG - Massive file errors somewhere between creation and moving to to the upload folder :(
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

# 
#-----[ OPEN ]------------------------------------------ 
# 
includes/functions_validate.php

# 
#-----[ FIND ]------------------------------------------ 
# 
         if ( $row = $db->sql_fetchrow($result) ) 
         { 
            return array('error' => true, 'error_msg' => $lang['Email_taken']); 
         } 

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 

         //********************************Multiple Accounts Mod********************* 
         $masql = "SELECT * FROM " . CONFIG_TABLE . " WHERE config_name = 'allow_multiple'"; 
         if ( !($maresult = $db->sql_query($masql)) ) 
         { 
            message_die(GENERAL_ERROR, "Couldn't obtain user email information.", "", __LINE__, __FILE__, $sql); 
         } 
         $allow = $db->sql_fetchrow($maresult); 
         if ($allow['config_value'] == 0) 
         { 
            if ( $row = $db->sql_fetchrow($result) ) 
            { 
               return array('error' => true, 'error_msg' => $lang['Email_taken']); 
            } 
         } 
         //*******************************Multiple Accounts Mod********************** 

# 
#-----[ OPEN ]------------------------------------------ 
# 
admin/admin_board.php

# 
#-----[ FIND ]------------------------------------------ 
# 
$html_yes = ( $new['allow_html'] ) ? "checked=\"checked\"" : ""; 
$html_no = ( !$new['allow_html'] ) ? "checked=\"checked\"" : ""; 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
//****************Multiple Accounts Hack******************* 
$multiple_yes = ( $new['allow_multiple'] ) ? "checked=\"checked\"" : ""; 
$multiple_no = ( !$new['allow_multiple'] ) ? "checked=\"checked\"" : ""; 
//*********************Multiple Accounts Hack************************ 

# 
#-----[ FIND ]------------------------------------------ 
# 
   "HTML_NO" => $html_no, 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

   //***********Multiple Accounts Mod**************** 
   "MULTIPLE_YES" => $multiple_yes, 
   "MULTIPLE_NO" => $multiple_no, 
   //***********Multiple Accounts Mod**************** 


# 
#-----[ OPEN ]------------------------------------------ 
# 
templates/subSilver/admin/board_config_body.tpl

# 
#-----[ FIND ]------------------------------------------ 
# 
   <tr> 
      <td class="row1">{L_ALLOW_HTML}</td> 
      <td class="row2"><input type="radio" name="allow_html" value="1" {HTML_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="allow_html" value="0" {HTML_NO} /> {L_NO}</td> 
   </tr> 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
   <tr> 
      <td class="row1">Allow Multiple Accounts per Email Address</td> 
      <td class="row2"><input type="radio" name="allow_multiple" value="1" {MULTIPLE_YES} /> Yes&nbsp;&nbsp;<input type="radio" name="allow_multiple" value="0" {MULTIPLE_NO} />No</td> 
   </tr> 

# 
#-----[ SQL ]------------------------------------------ 
# 
INSERT INTO prefix_config (config_name, config_value) VALUES ('allow_multiple', '1'); 

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM 